<template>
  <div class="list-content">
    <ScrollView  :loadCallback="onLoadPage" :is_end="is_end" :ready_to_load="ready_to_load" :page="cate_page">
      <ListItem :key="index" :data="item"  v-for="(item,index) in cate_list"></ListItem>
    </ScrollView>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import  ScrollView from "@/components/common/ScrollView"
  import  ListItem from "@/components/common/ListItem"
  export default {
    name: 'CateContentList',
    data(){
      return {}
    },
    components:{
      ScrollView,
      ListItem
    },
    created() {

    },
    computed: {
    ...mapState(['cate_list','is_end','ready_to_load','type','cate_id',"cate_page",'close_panel_current']),
    },
    methods:{
      onLoadPage(){
        let page=this.cate_page;
        if(this.close_panel_current==false)
          return
        this.$store.dispatch('cateQuery',[this.cate_id,this.type,page+1])
      }
    }
  }
</script>

<style lang="stylus" scoped>
  @import '~@/assets/main.styl'
  .list-content {
    padding-bottom: (1rem);
    padding-top: (0.9rem);
  }
</style>
